package com.cangjie.xiaozhi

import org.junit.Test
import org.junit.Assert.*
import java.awt.Dimension
import javax.swing.JButton
import javax.swing.JPanel

class XiaozhiToolWindowUiTest {
    
    @Test
    fun `test refresh button creation`() {
        // 测试XiaozhiToolWindowFactory是否能正确创建
        val toolWindowFactory = XiaozhiToolWindowFactory()
        assertNotNull("XiaozhiToolWindowFactory实例应该能正确创建", toolWindowFactory)
    }
    
    @Test
    fun `test refresh button properties`() {
        // 测试刷新按钮属性
        val button = JButton()
        button.preferredSize = Dimension(30, 30)
        
        assertEquals("按钮宽度应该是30", 30, button.preferredSize.width)
        assertEquals("按钮高度应该是30", 30, button.preferredSize.height)
    }
    
    @Test
    fun `test panel layout`() {
        // 测试面板布局
        val panel = JPanel(null) // 使用null布局进行绝对定位
        assertNull("面板布局应该为null（绝对定位）", panel.layout)
    }
}